package 面向对象;

public class RoleTest {
    public static void main(String[] args) {
        Role name1 = new Role("小王", 23, '男', 100);
        Role name2 = new Role("小李", 24, '女', 100);
        name1.RoleInfo();
        name2.RoleInfo();
        while (true) {
            //name1攻击name2
            name1.attak(name2);
            if (name2.getBlood() == 0) {
                System.out.println(name1.getName() + "K.O了" + name2.getName());
                break;
            }
            //name2攻击name1
            name2.attak(name1);
            if (name1.getBlood() == 0) {
                System.out.println(name2.getName() + "K.O了" + name1.getName());
                break;
            }
        }
    }
}